using System.Collections.Generic;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing
{
	internal class OracleLpTypeConstructorExpression : OracleLpExpression
	{
		protected OracleLpName m_vName;

		protected OracleLpName m_vParentObjectName;

		protected bool m_vNew;

		protected List<OracleLpExpression> m_vParameters;

		public OracleLpName Name
		{
			get
			{
				return m_vName;
			}
			set
			{
				m_vName = value;
			}
		}

		public OracleLpName ParentObjectName
		{
			get
			{
				return m_vParentObjectName;
			}
			set
			{
				m_vParentObjectName = value;
			}
		}

		public bool New
		{
			get
			{
				return m_vNew;
			}
			set
			{
				m_vNew = value;
			}
		}

		public List<OracleLpExpression> Parameters => m_vParameters;

		public OracleLpTypeConstructorExpression(OracleLpStatementElement parent)
			: base(parent)
		{
			m_vExpressionType = OracleLpExpressionType.TYPE_CONSTRUCTOR_EXPRESSION;
		}

		public void CreateParametersList()
		{
			if (m_vParameters == null)
			{
				m_vParameters = new List<OracleLpExpression>();
			}
		}

		public void ParametersChanged()
		{
			m_vAllTerminalExpressions = null;
		}

		public override IList<OracleLpExpression> GetAllTerminalExpressions()
		{
			if (m_vAllTerminalExpressions == null)
			{
				List<OracleLpExpression> list = (List<OracleLpExpression>)(m_vAllTerminalExpressions = new List<OracleLpExpression>());
				if (m_vParameters != null)
				{
					foreach (OracleLpExpression vParameter in m_vParameters)
					{
						list.AddRange(vParameter.GetAllTerminalExpressions());
					}
				}
			}
			return m_vAllTerminalExpressions;
		}
	}
}
